#!/bin/bash -x
# To see the effects of oversubscribing.
# CAUTION: Run this script on one node and one core. nodes=1:nnp=2

ulimit -s unlimited
mv tests/overSub1.txt tests/overSub1.txt.`date +%s`
transactions1=125155

minSup=$((transactions1 - transactions1 / 10))
percentage=90
while [ $percentage -gt 40 ]; do
    percentage=$((percentage - 10))
    minSup=$((minSup - transactions1 / 10))
done

# number of processors will start from 2.
numberOfProcs=1
maxProcs=9

while [ $numberOfProcs -lt $maxProcs ]; do
    echo -n `mpirun -np $numberOfProcs ./cpMpiReduce.openmpi -r -i data.nitems_0.1.patlen_80.ntrans_250.ascii.125155 -t 125155 -d 2 -s $minSup` >> tests/overSub1.txt
    echo " $numberOfProcs" >> tests/overSub1.txt
    numberOfProcs=$((numberOfProcs + 1))    
done    
